package com.wenson.structural.flyweight;

/**
 * @ClassName: FlyWeightClient
 * @Author: luowangcheng
 * @Date: 2024/6/14 8:21
 * @Description:
 */
public class FlyWeightClient {
    public static void main(String[] args) {
        TileFactory factory = new TileFactory();
        factory.getDrawable("河流").draw(10, 10);
        factory.getDrawable("河流").draw(10, 20);
        factory.getDrawable("道路").draw(10, 30);
        factory.getDrawable("道路").draw(10, 40);
        factory.getDrawable("草地").draw(10, 50);
        factory.getDrawable("草地").draw(10, 60);
        factory.getDrawable("草地").draw(10, 70);
        factory.getDrawable("草地").draw(10, 80);
        factory.getDrawable("道路").draw(10, 90);
        factory.getDrawable("道路").draw(10, 100);
        //绘制完地板后，接着在顶层绘制房屋
        factory.getDrawable("房屋").draw(10, 10);
        factory.getDrawable("房屋").draw(10, 50);

        //在地图第一行随便绘制一些图块
//        new Tile("河流", 10, 10).draw();
//        new Tile("河流", 10, 20).draw();
//        new Tile("道路", 10, 30).draw();
//        new Tile("草地", 10, 40).draw();
//        new Tile("草地", 10, 50).draw();
//        new Tile("草地", 10, 60).draw();
//        new Tile("草地", 10, 70).draw();
//        new Tile("道路", 10, 80).draw();
//        new Tile("道路", 10, 90).draw();
//        new Tile("道路", 10, 100).draw();
    }
}
